syms a b c d b1 b2
A=[a b b1 ; c d b2];
A(2,:)=A(2,:)-A(2,1)/A(1,1)*A(1,:);
A(2,:)=A(2,:)*a;
simplify(A)
A